#include<iostream>
#include<map>
using namespace std;
const int N = 1e5 + 10;
map<int, int>mp;
int arr[N];
int f[N];
int n, m, x;
int main()
{
	cin >> n >> m >> x;
	for (int i = 1; i <= n; i++) {
		cin >> arr[i];
		int k = arr[i] ^ x;
		f[i] = max(f[i - 1], mp[k]);
		//cout << "i===" << i << "   " << "f[i] === " << f[i] << endl;
		mp[arr[i]] = i;
	}
	while (m--) {
		int l, r;
		cin >> l >> r;
		if (f[r] >= l)cout << "yes" << endl;
		else cout << "no" << endl;
	}
	return 0;
}